<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      window.addEventListener("DOMContentLoaded", () => {
        console.log("DOMContentLoaded触发");
      });
      window.addEventListener("load", () => {
        console.log("load触发");
      });
    </script>
    <script src="./defer.js" async></script>
    <div class="hello">hello world</div>
    <script>
      let i = 1;
      const domList = document.createElement("div");
      while (i < 10) {
        const dom = document.createElement("div");
        dom.innerText = i++;
        domList.appendChild(dom);
      }
      document.body.appendChild(domList);
    </script>
  </body>
</html>
